﻿using WCS.Entities;

namespace WCS.ViewModels
{
    public class PortDto
    {
        public string Id { get; set; }

        public string DeviceIP { get; set; } //设备IP地址
        public string Name { get; set; }

        public string DeviceId { get; set; } //所属设备

        // public string AgvAddress { get; set; }

        public string PlcAddress { get; set; }

		public int Capacity { get; set; } 

		public int CurrentNumber { get; set; }

		public bool IsFull => CurrentNumber == Capacity;

		public string Region { get; set; }
        //public float XPosition { get; set; }  //X坐标

        //public float YPosition { get; set; } //Y坐标

        // public string Content { get; set; }

        // public string AvailabeAgvType { get; set; }
        public string LocationNumber { get; set; }

        // public string TriggerType { get; set; }
        public bool Enable { get; set; } = true;

        private string types;
        public string Types
        {
            get
            {
                if(string.IsNullOrEmpty(types))
                    types = string.Join(',', TaskType.Select(x => ((TaskType)x).GetDescription()).ToArray());
                return types;
            }

            set
            {
                types = value;
            }
        }
        public List<int> TaskType { get; set; } = new List<int>();

        public int Priority { get; set; }

        public string Remark { get; set; }
    }
}
